Skip to content

Add Clang tidy naming conventions #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 15, 2024

Conversation

Totto16
Copy link
Collaborator

@Totto16 Totto16 commented May 13, 2024

No description provided.

@Totto16 Totto16 changed the title Clang tidy naming conventions Add Clang tidy naming conventions May 13, 2024
Copy link

github-actions bot commented May 13, 2024

badge

Code Coverage Summary

Filename                                                 Stmts    Miss  Cover    Missing
-----------------------------------------------------  -------  ------  -------  ------------------------------------------------------------------------
src/application.cpp                                        172     172  0.00%    24-306
src/application.hpp                                         33      33  0.00%    63-119
src/discord/core.cpp                                       102     102  0.00%    12-181
src/discord/core.hpp                                         6       6  0.00%    61-70
src/game/bag.cpp                                            22      22  0.00%    3-33
src/game/bag.hpp                                             2       2  0.00%    15-16
src/game/game.cpp                                           61      61  0.00%    7-106
src/game/game.hpp                                            0       0  100.00%
src/game/graphic_helpers.cpp                                41      41  0.00%    11-93
src/game/grid.cpp                                           73      73  0.00%    6-112
src/game/grid.hpp                                            0       0  100.00%
src/game/mino.cpp                                           10      10  0.00%    3-20
src/game/mino.hpp                                            1       1  0.00%    19
src/game/mino_stack.cpp                                     55      55  0.00%    7-86
src/game/mino_stack.hpp                                      0       0  100.00%
src/game/rotation.cpp                                       23      23  0.00%    5-37
src/game/tetrion.cpp                                       413     413  0.00%    18-651
src/game/tetrion.hpp                                         7       7  0.00%    123-129
src/game/tetromino.cpp                                      44      44  0.00%    5-75
src/game/tetromino.hpp                                       5       5  0.00%    18-29
src/game/tetromino_type.cpp                                 22      22  0.00%    5-45
src/graphics/point.hpp                                      24      24  0.00%    17-93
src/graphics/rect.hpp                                       23      23  0.00%    16-55
src/graphics/renderer.cpp                                   72      72  0.00%    6-123
src/graphics/renderer.hpp                                   30      30  0.00%    33-77
src/graphics/sdl_context.cpp                                14      14  0.00%    18-53
src/graphics/text.cpp                                       11      11  0.00%    6-25
src/graphics/text.hpp                                        0       0  100.00%
src/graphics/texture.cpp                                    71      71  0.00%    7-118
src/graphics/texture.hpp                                     9       9  0.00%    50-60
src/graphics/window.cpp                                     41      41  0.00%    6-62
src/helper/bool_wrapper.hpp                                  9       9  0.00%    14-34
src/helper/clock_source.cpp                                 28      28  0.00%    8-47
src/helper/clock_source.hpp                                  7       7  0.00%    9-24
src/helper/color.cpp                                        85      35  58.82%   11-31, 38-53, 61, 75, 145-156, 161-164
src/helper/color.hpp                                        94      76  19.15%   43, 47, 50, 75-103, 142-248
src/helper/color_literals.hpp                              320      30  90.62%   408, 575, 640-687, 701-704
src/helper/command_line_arguments.hpp                       38      38  0.00%    21-77
src/helper/const_utils.hpp                                  17       1  94.12%   72
src/helper/date.cpp                                         46      46  0.00%    9-113
src/helper/errors.cpp                                       27      27  0.00%    3-45
src/helper/errors.hpp                                        0       0  100.00%
src/helper/git_helper.hpp                                    2       2  0.00%    7-11
src/helper/graphic_utils.cpp                                16      16  0.00%    4-95
src/helper/message_box.cpp                                   7       7  0.00%    7-22
src/helper/music_utils.hpp                                   4       4  0.00%    9-30
src/helper/nfd.cpp                                         108     108  0.00%    21-196
src/helper/nfd_include.hpp                                   1       1  0.00%    23
src/helper/parse_json.cpp                                   23      23  0.00%    6-55
src/helper/parse_json.hpp                                   23      23  0.00%    53-87
src/helper/platform.cpp                                     12      12  0.00%    16-98
src/helper/platform.hpp                                      4       4  0.00%    14-36
src/helper/random.cpp                                       13      13  0.00%    4-24
src/helper/random.hpp                                        4       4  0.00%    21-24
src/helper/sleep.cpp                                        15      15  0.00%    20-71
src/helper/static_string.hpp                                30      30  0.00%    16-128
src/helper/timer.hpp                                        21      21  0.00%    16-49
src/helper/utils.hpp                                        19      19  0.00%    45-122
src/input/game_input.cpp                                    66      66  0.00%    8-99
src/input/game_input.hpp                                    13      13  0.00%    50-85
src/input/guid.cpp                                          17      17  0.00%    8-39
src/input/guid.hpp                                          46      46  0.00%    32-135
src/input/input.cpp                                        106     106  0.00%    16-218
src/input/input_creator.cpp                                 69      69  0.00%    17-143
src/input/input_creator.hpp                                  6       6  0.00%    20-31
src/input/input.hpp                                          9       9  0.00%    110-124
src/input/joystick_input.cpp                               109     109  0.00%    14-540
src/input/joystick_input.hpp                                52      52  0.00%    73-289
src/input/keyboard_input.cpp                               121     121  0.00%    8-213
src/input/keyboard_input.hpp                                28      28  0.00%    94-132
src/input/mouse_input.cpp                                   31      31  0.00%    9-70
src/input/mouse_input.hpp                                    0       0  100.00%
src/input/replay_input.cpp                                  50      50  0.00%    6-90
src/input/replay_input.hpp                                   0       0  100.00%
src/input/touch_input.cpp                                  156     156  0.00%    13-318
src/input/touch_input.hpp                                   54      54  0.00%    62-194
src/lobby/api.hpp                                           25      25  0.00%    143-235
src/manager/event_dispatcher.hpp                            71      71  0.00%    15-120
src/manager/event_listener.hpp                               8       8  0.00%    6-19
src/manager/font.cpp                                        12      12  0.00%    5-18
src/manager/font.hpp                                         4       4  0.00%    13-26
src/manager/music_manager.cpp                              216     216  0.00%    17-380
src/manager/music_manager.hpp                               12      12  0.00%    58-75
src/manager/resource_manager.hpp                             8       8  0.00%    18-37
src/manager/sdl_key.cpp                                    245      31  87.35%   25, 73, 152-154, 203-209, 220, 274, 332, 357, 412, 429, 439-460, 470-471
src/manager/sdl_key.hpp                                      3       3  0.00%    91-93
src/manager/service_provider.hpp                             2       2  0.00%    32-37
src/manager/settings_manager.cpp                            12      12  0.00%    7-27
src/manager/settings_manager.hpp                            14      14  0.00%    16-63
src/recordings/additional_information.cpp                  320     320  0.00%    9-544
src/recordings/additional_information.hpp                   23      23  0.00%    32-166
src/recordings/checksum_helper.cpp                          10      10  0.00%    5-21
src/recordings/checksum_helper.hpp                          13      13  0.00%    21-47
src/recordings/helper.hpp                                   81      81  0.00%    33-177
src/recordings/recording.cpp                                21      21  0.00%    6-47
src/recordings/recording.hpp                                 4       4  0.00%    48-57
src/recordings/recording_reader.cpp                        148     148  0.00%    10-279
src/recordings/recording_reader.hpp                          0       0  100.00%
src/recordings/recording_writer.cpp                         83      83  0.00%    4-172
src/recordings/recording_writer.hpp                          6       6  0.00%    52-59
src/recordings/tetrion_core_information.hpp                  6       6  0.00%    13-24
src/recordings/tetrion_snapshot.cpp                        100     100  0.00%    12-201
src/recordings/tetrion_snapshot.hpp                          0       0  100.00%
src/scenes/scene.cpp                                        19      19  0.00%    18-63
src/scenes/scene.hpp                                        13      13  0.00%    25-74
src/scenes/about_page/about_page.cpp                        57      57  0.00%    16-118
src/scenes/about_page/about_page.hpp                         0       0  100.00%
src/scenes/game_over/game_over.cpp                          26      26  0.00%    13-61
src/scenes/game_over/game_over.hpp                           0       0  100.00%
src/scenes/main_menu/main_menu.cpp                          95      95  0.00%    12-165
src/scenes/main_menu/main_menu.hpp                           0       0  100.00%
src/scenes/multiplayer_menu/multiplayer_menu.cpp            74      74  0.00%    12-134
src/scenes/multiplayer_menu/multiplayer_menu.hpp             0       0  100.00%
src/scenes/online_lobby/online_lobby.cpp                    89      89  0.00%    16-161
src/scenes/online_lobby/online_lobby.hpp                     0       0  100.00%
src/scenes/play_select_menu/play_select_menu.cpp            73      73  0.00%    11-128
src/scenes/play_select_menu/play_select_menu.hpp             0       0  100.00%
src/scenes/recording_selector/recording_chooser.cpp         75      75  0.00%    13-137
src/scenes/recording_selector/recording_chooser.hpp          0       0  100.00%
src/scenes/recording_selector/recording_component.cpp       93      93  0.00%    13-162
src/scenes/recording_selector/recording_component.hpp        1       1  0.00%    21
src/scenes/recording_selector/recording_selector.cpp       129     129  0.00%    29-232
src/scenes/recording_selector/recording_selector.hpp         2       2  0.00%    23-25
src/scenes/replay_game/replay_game.cpp                      66      66  0.00%    10-143
src/scenes/replay_game/replay_game.hpp                       0       0  100.00%
src/scenes/settings_menu/color_setting_row.cpp             123     123  0.00%    15-235
src/scenes/settings_menu/color_setting_row.hpp               0       0  100.00%
src/scenes/settings_menu/settings_details.hpp                1       1  0.00%    11
src/scenes/settings_menu/settings_menu.cpp                 112     112  0.00%    20-197
src/scenes/settings_menu/settings_menu.hpp                   2       2  0.00%    23-25
src/scenes/single_player_game/pause.cpp                     36      36  0.00%    11-63
src/scenes/single_player_game/pause.hpp                      0       0  100.00%
src/scenes/single_player_game/single_player_game.cpp        60      60  0.00%    14-115
src/scenes/single_player_game/single_player_game.hpp         0       0  100.00%
src/thirdparty/hash-library/sha256.cpp                     417     417  0.00%    40-604
src/ui/focusable.hpp                                        26      26  0.00%    14-65
src/ui/hoverable.hpp                                        28      28  0.00%    16-78
src/ui/layout.cpp                                           30      30  0.00%    5-62
src/ui/layout.hpp                                           38      38  0.00%    20-143
src/ui/widget.cpp                                            4       4  0.00%    6-11
src/ui/widget.hpp                                           12      12  0.00%    29-56
src/ui/components/abstract_slider.hpp                      115     115  0.00%    28-219
src/ui/components/button.hpp                                54      54  0.00%    29-130
src/ui/components/color_picker.cpp                         317     317  0.00%    17-565
src/ui/components/color_picker.hpp                           0       0  100.00%
src/ui/components/image_button.cpp                          12      12  0.00%    5-27
src/ui/components/image_button.hpp                           0       0  100.00%
src/ui/components/image_view.cpp                            16      16  0.00%    5-34
src/ui/components/image_view.hpp                             0       0  100.00%
src/ui/components/label.cpp                                 15      15  0.00%    6-36
src/ui/components/label.hpp                                  0       0  100.00%
src/ui/components/link_label.cpp                            43      43  0.00%    6-81
src/ui/components/link_label.hpp                             0       0  100.00%
src/ui/components/slider.cpp                                39      39  0.00%    7-75
src/ui/components/slider.hpp                                 0       0  100.00%
src/ui/components/text_button.cpp                           33      33  0.00%    5-65
src/ui/components/text_button.hpp                            0       0  100.00%
src/ui/components/textinput.cpp                            248     248  0.00%    13-438
src/ui/layouts/focus_layout.cpp                            147     147  0.00%    10-261
src/ui/layouts/focus_layout.hpp                             28      28  0.00%    40-97
src/ui/layouts/grid_layout.cpp                              63      63  0.00%    5-100
src/ui/layouts/grid_layout.hpp                               0       0  100.00%
src/ui/layouts/scroll_layout.cpp                           197     197  0.00%    6-329
src/ui/layouts/scroll_layout.hpp                            13      13  0.00%    72-90
src/ui/layouts/tile_layout.cpp                              62      62  0.00%    5-92
src/ui/layouts/tile_layout.hpp                               9       9  0.00%    31-49
TOTAL                                                     7852    7264  7.49%

Results for commit: 011b4f9

Minimum allowed coverage is 0%

♻️ This comment has been updated with latest results

@Totto16 Totto16 added the maintenance Maintenance related task label May 13, 2024
@Totto16 Totto16 force-pushed the clang-tidy-naming-conventions branch from 7c1481f to 6a79c02 Compare May 15, 2024 21:11
@Totto16 Totto16 force-pushed the input-improvements branch from 33e2cbf to 5b595be Compare May 15, 2024 21:49
Totto16 added 13 commits May 16, 2024 00:10
-  add naming conventions checks
- remove deprecated setting "AnalyzeTemporaryDtors" (deprecated in clang-tidy 16 and removed in clang-tidy 18)
- remove defaults
- add some more global checks
- add back some checks, that where ignored before
- use std::ranges where possible
 remove c++20 and only use c++23 and c++26 (preview)
@Totto16 Totto16 force-pushed the clang-tidy-naming-conventions branch from 12b9748 to 011b4f9 Compare May 15, 2024 22:15
@Totto16 Totto16 merged commit e6ca4fa into input-improvements May 15, 2024
16 of 18 checks passed
@Totto16 Totto16 deleted the clang-tidy-naming-conventions branch May 15, 2024 22:15
Copy link

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy reports: 10 concern(s)
  • src/helper/color_literals.hpp:250:5: warning: [readability-function-cognitive-complexity]

    function 'get_color_from_rgb_string' has cognitive complexity of 104 (threshold 50)

      250 |     get_color_from_rgb_string(const char* input, std::size_t) {
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:252:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      252 |         if (input[0] == 'r' && input[1] == 'g' && input[2] == 'b') {
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:252:48: note: +1
      252 |         if (input[0] == 'r' && input[1] == 'g' && input[2] == 'b') {
          |                                                ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:253:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      253 |             if (input[3] == '(') {
          |             ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:257:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      257 |                 PROPAGATE(r_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:257:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      257 |                 PROPAGATE(r_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:261:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      261 |                 if (r > std::numeric_limits<u8>::max()) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:267:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      267 |                 if (*next_g != ',') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:275:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      275 |                 PROPAGATE(g_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:275:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      275 |                 PROPAGATE(g_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:279:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      279 |                 if (g > std::numeric_limits<u8>::max()) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:285:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      285 |                 if (*next_b != ',') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:293:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      293 |                 PROPAGATE(b_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:293:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      293 |                 PROPAGATE(b_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:297:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      297 |                 if (b > std::numeric_limits<u8>::max()) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:303:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      303 |                 if (*end != ')') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:308:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      308 |                 if (*(end + 1) != '\0') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:322:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      322 |             if (input[3] == 'a' && input[4] == '(') {
          |             ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:322:33: note: +1
      322 |             if (input[3] == 'a' && input[4] == '(') {
          |                                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:326:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      326 |                 PROPAGATE(r_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:326:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      326 |                 PROPAGATE(r_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:330:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      330 |                 if (r > std::numeric_limits<u8>::max()) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:336:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      336 |                 if (*next_g != ',') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:344:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      344 |                 PROPAGATE(g_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:344:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      344 |                 PROPAGATE(g_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:348:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      348 |                 if (g > std::numeric_limits<u8>::max()) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:354:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      354 |                 if (*next_b != ',') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:362:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      362 |                 PROPAGATE(b_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:362:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      362 |                 PROPAGATE(b_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:366:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      366 |                 if (b > std::numeric_limits<u8>::max()) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:372:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      372 |                 if (*next_a != ',') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:379:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      379 |                 PROPAGATE(a_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:379:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      379 |                 PROPAGATE(a_result, ColorFromRGBStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:383:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      383 |                 if (a > std::numeric_limits<u8>::max()) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:390:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      390 |                 if (*end != ')') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:395:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      395 |                 if (*(end + 1) != '\0') {
          |                 ^
  • src/helper/color_literals.hpp:250:61: warning: [readability-named-parameter]

    all parameters should be named in a function

      250 |     get_color_from_rgb_string(const char* input, std::size_t) {
          |                                                             ^
          |                                                              /*unused*/
  • src/helper/color_literals.hpp:418:5: warning: [readability-function-cognitive-complexity]

    function 'get_color_from_hsv_string' has cognitive complexity of 110 (threshold 50)

      418 |     get_color_from_hsv_string(const char* input, std::size_t) {
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:420:9: note: +1, including nesting penalty of 0, nesting level increased to 1
      420 |         if (input[0] == 'h' && input[1] == 's' && input[2] == 'v') {
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:420:48: note: +1
      420 |         if (input[0] == 'h' && input[1] == 's' && input[2] == 'v') {
          |                                                ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:421:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      421 |             if (input[3] == '(') {
          |             ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:425:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      425 |                 PROPAGATE(h_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:425:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      425 |                 PROPAGATE(h_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:429:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      429 |                 if (h < 0.0 || h > 360.0) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:429:29: note: +1
      429 |                 if (h < 0.0 || h > 360.0) {
          |                             ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:435:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      435 |                 if (*next_s != ',') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:443:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      443 |                 PROPAGATE(s_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:443:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      443 |                 PROPAGATE(s_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:447:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      447 |                 if (s < 0.0 || s > 1.0) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:447:29: note: +1
      447 |                 if (s < 0.0 || s > 1.0) {
          |                             ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:453:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      453 |                 if (*next_v != ',') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:461:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      461 |                 PROPAGATE(v_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:461:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      461 |                 PROPAGATE(v_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:465:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      465 |                 if (v < 0.0 || v > 1.0) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:465:29: note: +1
      465 |                 if (v < 0.0 || v > 1.0) {
          |                             ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:471:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      471 |                 if (*end != ')') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:476:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      476 |                 if (*(end + 1) != '\0') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:490:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      490 |             if (input[3] == 'a' && input[4] == '(') {
          |             ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:490:33: note: +1
      490 |             if (input[3] == 'a' && input[4] == '(') {
          |                                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:494:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      494 |                 PROPAGATE(h_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:494:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      494 |                 PROPAGATE(h_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:498:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      498 |                 if (h < 0.0 || h > 360.0) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:498:29: note: +1
      498 |                 if (h < 0.0 || h > 360.0) {
          |                             ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:504:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      504 |                 if (*next_s != ',') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:512:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      512 |                 PROPAGATE(s_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:512:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      512 |                 PROPAGATE(s_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:516:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      516 |                 if (s < 0.0 || s > 1.0) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:516:29: note: +1
      516 |                 if (s < 0.0 || s > 1.0) {
          |                             ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:522:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      522 |                 if (*next_v != ',') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:530:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      530 |                 PROPAGATE(v_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:530:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      530 |                 PROPAGATE(v_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:534:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      534 |                 if (v < 0.0 || v > 1.0) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:534:29: note: +1
      534 |                 if (v < 0.0 || v > 1.0) {
          |                             ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:540:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      540 |                 if (*next_a != ',') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:547:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      547 |                 PROPAGATE(a_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:45:5: note: expanded from macro 'PROPAGATE'
       45 |     do {                     /*NOLINT(cppcoreguidelines-avoid-do-while)*/    \
          |     ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:547:17: note: +4, including nesting penalty of 3, nesting level increased to 4
      547 |                 PROPAGATE(a_result, ColorFromHSVStringReturnType, std::string);
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/const_utils.hpp:46:9: note: expanded from macro 'PROPAGATE'
       46 |         if (not((val).has_value())) {                                        \
          |         ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:551:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      551 |                 if (a > std::numeric_limits<u8>::max()) {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:558:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      558 |                 if (*end != ')') {
          |                 ^
    /home/runner/work/oopetris/oopetris/src/helper/color_literals.hpp:563:17: note: +3, including nesting penalty of 2, nesting level increased to 3
      563 |                 if (*(end + 1) != '\0') {
          |                 ^
  • src/helper/color_literals.hpp:418:61: warning: [readability-named-parameter]

    all parameters should be named in a function

      418 |     get_color_from_hsv_string(const char* input, std::size_t) {
          |                                                             ^
          |                                                              /*unused*/
  • src/helper/const_utils.hpp:31:9: warning: [cppcoreguidelines-macro-usage]

    function-like macro 'CONSTEVAL_STATIC_ASSERT' used; consider a 'constexpr' template function

       31 | #define CONSTEVAL_STATIC_ASSERT(CHECK, MSG)           \
          |         ^
  • src/helper/nfd.cpp:76:10: warning: [readability-identifier-naming]

    invalid case style for local variable 'filterItem'

       76 |     auto filterItem = get_filter_items(allowed_files);
          |          ^~~~~~~~~~
          |          filter_item
  • src/helper/nfd.cpp:116:10: warning: [readability-identifier-naming]

    invalid case style for local variable 'filterItem'

      116 |     auto filterItem = get_filter_items(allowed_files);
          |          ^~~~~~~~~~
          |          filter_item
  • src/input/input.cpp:150:70: warning: [readability-convert-member-functions-to-static]

    method 'get_game_input' can be made static

      150 | [[nodiscard]] std::shared_ptr<input::GameInput> input::InputManager::get_game_input(ServiceProvider* service_provider) {
          |                                                                      ^
  • src/ui/components/textinput.cpp:105:16: warning: [readability-function-cognitive-complexity]

    function 'handle_event' has cognitive complexity of 51 (threshold 50)

      105 | ui::TextInput::handle_event(const std::shared_ptr<input::InputManager>& input_manager, const SDL_Event& event) {
          |                ^
    ../src/ui/components/textinput.cpp:108:5: note: +1, including nesting penalty of 0, nesting level increased to 1
      108 |     if (const auto hover_result = detect_hover(input_manager, event); hover_result) {
          |     ^
    ../src/ui/components/textinput.cpp:109:9: note: +2, including nesting penalty of 1, nesting level increased to 2
      109 |         if (hover_result.is(ActionType::Clicked)) {
          |         ^
    ../src/ui/components/textinput.cpp:119:5: note: +1, including nesting penalty of 0, nesting level increased to 1
      119 |     switch (event.type) {
          |     ^
    ../src/ui/components/textinput.cpp:121:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      121 |             switch (event.key.keysym.sym) {
          |             ^
    ../src/ui/components/textinput.cpp:132:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      132 |                     if (not m_text.empty()) {
          |                     ^
    ../src/ui/components/textinput.cpp:133:25: note: +4, including nesting penalty of 3, nesting level increased to 4
      133 |                         if (remove_all) {
          |                         ^
    ../src/ui/components/textinput.cpp:147:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      147 |                     if (m_cursor_position != 0) {
          |                     ^
    ../src/ui/components/textinput.cpp:148:25: note: +4, including nesting penalty of 3, nesting level increased to 4
      148 |                         if ((event.key.keysym.mod & KMOD_CTRL) != 0) {
          |                         ^
    ../src/ui/components/textinput.cpp:150:27: note: +1, nesting level increased to 4
      150 |                         } else {
          |                           ^
    ../src/ui/components/textinput.cpp:160:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      160 |                     if (m_cursor_position < current_string_length) {
          |                     ^
    ../src/ui/components/textinput.cpp:161:25: note: +4, including nesting penalty of 3, nesting level increased to 4
      161 |                         if ((event.key.keysym.mod & KMOD_CTRL) != 0) {
          |                         ^
    ../src/ui/components/textinput.cpp:164:27: note: +1, nesting level increased to 4
      164 |                         } else {
          |                           ^
    ../src/ui/components/textinput.cpp:173:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      173 |                     if ((event.key.keysym.mod & KMOD_CTRL) != 0) {
          |                     ^
    ../src/ui/components/textinput.cpp:175:25: note: +4, including nesting penalty of 3, nesting level increased to 4
      175 |                         if (SDL_HasClipboardText() != SDL_FALSE) {
          |                         ^
    ../src/ui/components/textinput.cpp:177:29: note: +5, including nesting penalty of 4, nesting level increased to 5
      177 |                             if (SDL_strlen(static_cast<const char*>(event.text.text)) == 0) {
          |                             ^
    ../src/ui/components/textinput.cpp:193:21: note: +3, including nesting penalty of 2, nesting level increased to 3
      193 |                     if ((event.key.keysym.mod & KMOD_CTRL) != 0) {
          |                     ^
    ../src/ui/components/textinput.cpp:195:25: note: +4, including nesting penalty of 3, nesting level increased to 4
      195 |                         if (result != 0) {
          |                         ^
    ../src/ui/components/textinput.cpp:210:13: note: +2, including nesting penalty of 1, nesting level increased to 2
      210 |             if (SDL_strlen(static_cast<const char*>(event.text.text)) == 0 or event.text.text[0] == '\n') {
          |             ^
    ../src/ui/components/textinput.cpp:210:76: note: +1
      210 |             if (SDL_strlen(static_cast<const char*>(event.text.text)) == 0 or event.text.text[0] == '\n') {
          |                                                                            ^
  • tests/core/color.cpp:259:23: warning: [google-readability-avoid-underscore-in-googletest-name]

    avoid using "_" in test name "RGG_to_HSV_to_RGB" according to Googletest FAQ

      259 | TEST(ColorConversion, RGG_to_HSV_to_RGB) {
          |                       ^

Have any feedback or feature suggestions? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance related task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant